/******************************************************************************
*  author: hnuweiwei@gmail.com
*  version: 1.0
*  file: Verylong.h
*  date: 2014.07.09
*  description: long int defination
*  other:
******************************************************************************/
#ifndef VERYLONG
#define VERYLONG

#include <vector>  

using namespace std;

class very_long_int {

	friend istream& operator>>(istream& stream, very_long_int& very_long);
	friend ostream& operator<<(ostream& stream, const very_long_int very_long);

protected:
	vector<char> digits;

	//If i >= digits.size(), 0 has been returned; elsethe ith least significant digit in digits hasbeen returned.
	//The least significant digit is the 0th least significant digit.
	char least(unsigned i) const;

public:

	very_long_int();

	// The value of the very_long_int is theunsigned int n.
	very_long_int(unsigned n);

	// The value of the very_long_int is the unsigned int n.
	void initialize(unsigned n);

	very_long_int operator+(const very_long_int &other_very_long);

	bool operator<(const very_long_int& other_very_long) const;

	bool operator>(const very_long_int& other_very_long) const;

	bool operator==(const very_long_int& other_very_long) const;

	very_long_int fibonacci(unsigned n);

};

#endif
